﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MaterPage/Site.Master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="Js_Study.Check_Load_Complete.WebForm1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <input type="button" value="Click Me" id="btn1" />

    <table id="tab1">
        <tr style="">
            <td >
                <input type="button" value="Click Me" id="Button1" /></td>
            <td>
                <input type="button" value="Click Me" id="Button2" /></td>
        </tr>
        <tr>
            <td>
                <input type="button" value="Click Me1" tag="b" /></td>
            <td>
                <input type="button" value="Click Me2" tag="b" /></td>
        </tr>
        <tr>
            <td>
                <input type="button" value="Click Me" id="Button5" /></td>
            <td>
                <input type="button" value="Click Me" id="Button6" /></td>
        </tr>
    </table>
    <script type="text/javascript">
        (function () {
            if ($("#non_featuredArea1").find("a").length > 0) {
                $("#non_featuredArea1").find("a").each(function () {
                    console.log("222");
                    if ($(this).html() == "Финансовый директор цифровой эпохи") {
                        console.log("111");
                        $(this).parent().parent().prev().attr("tag", "dc");
                        $(this).parent().parent().prev().find("a").attr("href", videoLink);
                        $(this).parent().parent().prev().find("a").attr("onclick", "return false");
                    } else {
                        //$(this).parent().attr("tag", "dc_default");
                    }
                });
                return;
            }
            var _args = arguments.callee;

            setTimeout(_args, 100);
        })();

        (function () {
            if ($("#xxx").length > 0) {

                $("#xxx").get(0).onclick = function () {
                    alert(1);
                }
                return;
            }
            var _args = arguments.callee;

            setTimeout(_args, 100);
        })();

        (function () {
            console.log(1);
            var b = $("#btn1");
            if (b.length > 0) {
                b.get(0).onclick = function () {
                    alert(1);
                }
                return;
            }

            var arg = arguments.callee;

            setTimeout(arg, 100);
        })();

        (function () {
            var obj = null;

            $("#tab1 tr").each(function () {
                $(this).find("td input[tag=b]").each(function () {
                    if ($(this).attr("value") == "Click Me1") {
                        obj = $(this);
                    }
                })
            })

            console.log(2222);
            if (obj != null && obj != undefined) {
                obj.get(0).onclick = function () {
                    alert(2);
                }
                return;
            }

            var arg = arguments.callee;

            setTimeout(arg, 100);
        })();

        function cutString(str, strcutlength) {
            var result = "";
            var num = 0;
            var count = str.length;
            for (i = 0; i < count; i++) {
                if (str.charCodeAt(i) > 255) {
                    num = num + 2;
                }
                else {
                    num = num + 1;
                }
                if (num > strcutlength) {
                    result = result + "<br/>" + String.fromCharCode(str.charCodeAt(i));
                    num = num - strcutlength;
                }
                else {
                    result = result + String.fromCharCode(str.charCodeAt(i));
                }
            }
            return result;
        };

        line.prototype.timer = function () {
            this.render();
            var that = this;
            var _arg = arguments;
            window.requestAnimationFrame(function () { _arg.callee.apply(that, _arg) });
        }
    </script>
</asp:Content>
